package com.sh.caryr.erp.entity.product;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sh.caryr.erp.entity.BaseEntity;
import com.sh.caryr.erp.entity.stock.Sku;
import com.sh.caryr.erp.entity.enums.ProductStatus;
import com.sh.caryr.erp.entity.enums.ProductTypeEnum;
import com.sh.caryr.erp.util.ERPConstants;
import com.sh.caryr.erp.util.UtilityTool;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 商品表
 * </p>
 *
 * @author milkeeper
 * @since 2017-11-28
 */
@TableName("erp_product")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Product extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 类型，普通商品：0，含sku套件：1，不含sku套件：2
     */
    private ProductTypeEnum type;
    /**
     * 公司代码
     */
    @Excel(name = "公司代码")
    private String coco;
    /**
     * 店铺ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long shopId;
    /**
     * 条形码
     */
    @Excel(name = "条形码")
    private String serialNo = "";
    /**
     * 商家编码
     */
    @Excel(name = "商家编码")
    private String code;
    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    private String name;
    /**
     * 品牌
     */
    @Excel(name = "品牌")
    private String brand;
    /**
     * 简介
     */
    @Excel(name = "简介")
    private String shortDesc;
    /**
     * 描述
     */
    @Excel(name = "描述")
    private String description;
    /**
     * 种类
     */
    @Excel(name = "种类")
    private String category;
    /**
     * 成本价
     */
    @Excel(name = "成本价")
    private Float purchasePrice;
    /**
     * 销售价
     */
    @Excel(name = "销售价")
    private Float salePrice;
    /**
     * 供货价
     */
    @Excel(name = "供货价")
    private Float supplyPrice;
    /**
     * 批发价
     */
    @Excel(name = "批发价")
    private Float tradePrice;
    /**
     * 包装规格
     */
    @Excel(name = "包装规格")
    private String packaging;
    /**
     * 图片
     */
    @Excel(name = "图片")
    private String img;
    /**
     * 长
     */
    @Excel(name = "长")
    private Float length;
    /**
     * 宽
     */
    @Excel(name = "宽")
    private Float width;
    /**
     * 高
     */
    @Excel(name = "高")
    private Float height;
    /**
     * 毛重
     */
    @Excel(name = "毛重")
    private Float grossWeight;
    /**
     * 净重
     */
    @Excel(name = "净重")
    private Float netWeight;
    /**
     * 商品状态，1：正常，2，停用
     */
    private ProductStatus status;
    /**
     * 总数量
     */
    @TableField(exist = false)
    private Integer totalAmount;

    /**
     * 次品数量
     */
    @TableField(exist = false)
    private Integer notGoodAmount;

    /**
     * 锁定数量
     */
    @TableField(exist = false)
    private Integer lockedAmount;

    /**
     * sku列表
     */
    @ExcelCollection(name = "sku")
    @TableField(exist = false)
    private List<Sku> skuList;

    /**
     * 套件列表
     */
    @TableField(exist = false)
    private List<CombDetail> combDetailList;
    /**
     * 套件列表
     */
    @TableField(exist = false)
    private List<ProductSpec> productSpecList;

}
